<template>
	<view class="main">
		
		<view class="section">
			<view class="title">系统名称：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.sys_name}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">提出公司：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.company}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">提出人：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.name}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">问题类型：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.cate}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">负责厂家：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.cj}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">提出时间：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text">{{data.propose_time}}</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">处理状态：</view>
			<view class="content">
				<view class="input_bg">
					<view class="text" v-if="data.status == 0">待解决</view>
					<view class="text" v-else-if="data.status == 1">已解决</view>
					<view class="text" v-else>待沟通</view>
				</view>
			</view>
		</view>
		<view class="section">
			<view class="title">问题内容：</view>
			<view class="content">
				<view class="text_bg">
					<view class="text">{{data.content}}</view>
				</view>
			</view>
		</view>
		
		<view class="section">
			<view class="title">问题照片</view>
			<view class="content">
				<view class="imgs">
					<view class="item" v-for="(pre, p_index) in pre_imgs" :key="p_index">
						<image class="image" :src="pre"></image>
					</view>
				</view>
			</view>
		</view><!-- section end-->
		<view class="section">
			<view class="title">备注：</view>
			<view class="content">
				<view class="text_bg">
					<view class="text">{{data.remark}}</view>
				</view>
			</view>
		</view>
		<view class="section bottom">
			<view class="title">原因说明：</view>
			<view class="content">
				<view class="text_bg">
					<view class="text">{{data.reason}}</view>
				</view>
			</view>
		</view>
		
		<!-- <view class="footer">
			<view class="submit-btn" @click="submitEvent()">确认提交</view>
		</view> -->
		
	</view><!-- main end-->
</template>

<script>
	import {getDetail} from "@/api/question";
	export default {
		data() {
			return {
				sys_name:'',//
				content:'',//客户电话
				company:'',
				name:'',
				cate:'',
				cj:'',
				pre_imgs:[],//安装前图片
				width:0,
				data:undefined
			}
		},
		onLoad(options) {
			let id = options.id;
			this.getData(id);
		},
		onShareTimeline() {
			return {
				title: '问题采集',
				//分享朋友圈的参数
				query: "isShare=1&id=",
			}
		},
		onShareAppMessage(){
		},
		methods: {
			getData(id){
				let that = this;
				uni.showLoading({
					title:"加载中..."
				});
				getDetail(id).then((res)=>{ 
					uni.hideLoading();
					if(res.status == 200){
						that.data = res.data;
						if(that.data.pre_imgs){
							that.pre_imgs = that.data.pre_imgs.split(',');
						}
					}else{
						uni.showToast({
							title:res.msg
						});
					}
				}).catch((error)=>{
					uni.hideLoading(); 
					console.log(error);
				});
				
			}
		}
	}
</script>

<style lang="scss">
	page {
	  width: 100%;
	  height: 100%;
	  background-color: white;
	}
	.main {
		display: flex;
		flex-direction: column;
		// align-items: center;
		padding: 30rpx;
		padding-bottom: 0;  
		padding-bottom: constant(safe-area-inset-bottom);  
		padding-bottom: env(safe-area-inset-bottom); 
		.mb100{
			padding-bottom: 150rpx;
		}
		.section{
			display: flex;
			flex-direction: column;
			margin-top: 30rpx;
			.title{
				font-size: 28rpx;
			}
			.content{
				display: flex;
				flex-direction: column; 
				margin-top: 10rpx;
				.input_bg{
					display: flex;
					flex-direction: column;
					height: 80rpx;
					border: 1px solid #CCC;
					padding-left: 10rpx;
					padding-right: 10rpx;
					.input{
						font-size: 28rpx;
						height: 80rpx;
						line-height: 80rpx;
						.place{
							color: gray;
						}
						.text{
							color: #000000;
						}
					}
					.text{
						font-size: 28rpx;
						height: 80rpx;
						line-height: 80rpx;
					}
				}
				.text_bg{
					display: flex;
					flex-direction: column;
					height: 160rpx;
					border: 1px solid #CCC;
					padding: 10rpx;
					.textarea{
						font-size: 28rpx;
					}
					.text{
						font-size: 28rpx;
					}
				}
				.imgs{
					display: flex;
					// padding-left: 10rpx;
					// padding-right: 10rpx;
					flex-direction: row;
					flex-wrap: wrap;
					.item{
						width: 33.3%;
						height:220rpx; 
						.image{ 
							width:85%;
							height:85%;
						}
						.del{
							width:50rpx;
							height:50rpx;
							margin-left: -30rpx;
							margin-top: -20rpx;
							z-index: 99;
							position: absolute;
						}
					}
				}
				.radio{
					margin-top: 15rpx;
					font-size: 28rpx;
				}
				.sign{
					text-align: center;
					height: 300rpx;
					line-height: 300rpx;
					font-size: 28rpx;
					background-color: #F8F8F8;
				}
			}
			.intro{
				font-size: 28rpx;
				color: red;
				margin-top: 15rpx;
			}
			
		}
		.bottom{
			padding-bottom: 150rpx;
		}
	}
	.footer{
		height: 80rpx;
		width: 100%;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding-bottom: 0;  
		padding-bottom: constant(safe-area-inset-bottom);  
		padding-bottom: env(safe-area-inset-bottom); 
		.submit-btn{
			background-color: $uni-main-color;
			color: white;
			font-size: 28rpx;
			height: 80rpx;
			width: 100%;
			text-align: center;
			line-height: 80rpx;
		}
	}
	/****/
	.popup-cls{
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}
	
	.pop-info{
		width:100%;
		background-color: white;
		display: flex;
		flex-direction: column;
		.pupop-btn{
			height: 40px;
			display: flex;
			align-items: center;
			padding: 0 30upx;
			justify-content: space-between;
			font-size: 28rpx;
		}
	}
	.pop-top{
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		font-weight: bold;
		color: #000000;
		margin-top: 20rpx;
		text-align: center;
		height: 40rpx;
	}
	
	.center{
		height: 420rpx;
		margin: 30rpx 0rpx 0rpx 0rpx;
		background-color: #F8F8F8;
	}
	
	.bottom{
		display: flex;
		flex-direction: row;
		justify-content: center;
		.btn{
			flex: 1;
			height:80rpx;
			background-color: $uni-main-color;
			// border-radius: 40rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 80rpx;
			// margin-bottom: 30rpx;
			font-size: 28rpx;
		}
		.mr1{
			margin-right: 1rpx;
		}
	}
	
	.picker-view {
		width: 100%;
		height: 340rpx;
		margin-top: 20rpx;
		.item {
			height: 50px;
			align-items: center;
			justify-content: center;
			text-align: center;
			line-height: 50px;
			font-size: 28rpx;
		}
	}
</style>
